package com.kedi.welfarecenter.read.dao.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @ClassName	WelfareMapper
 * @author: 	dw
 * @date: 		2019/7/26	14:42
 */
@Mapper
public interface WelfareMapper {
    /*@Insert("insert into welfare (name,price,givetime,uploadtime,older_idcard,older_name,giveusername,giveuseridcard) " +
            "VALUES(${name},#{price},now(),now(),${olderIdcard},${olderName},\n" +
            "${giveusename},${giveUseriDcard})")
    Integer insert(@Param("name") String name,@Param("price")Integer price
            ,@Param("olderIdcard") String olderIdcard,@Param("olderName") String olderName,@Param("giveusename" )String giveusemame,@Param("giveUseriDcard")String giveUseriDcard);*/
	
   /**
	* 					获取名政福利
	* @return			selectAll
	*/
   @Select("SELECT welfare_id,name,price,givetime,uploadtime,older_idcard,older_name,giveusername,giveuseridcard from welfare where type=6")
   List<Map<String, Object>> selectAll();
   /**
	* 					获取慧老活动对应得图片资源信息
	* @param			id
	* @return			selectAllByWelfareid
	*/
    @Select("SELECT welfare_id,name,price,givetime,uploadtime,older_idcard,older_name,giveusername,giveuseridcard from welfare where welfare_id=#{id}")
    Map<String, Object> selectAllByWelfareid(@Param("id") Integer id );
}
